from sklearn.preprocessing import MinMaxScaler, StandardScaler
import numpy as np
import matplotlib.pyplot as plt

np.random.seed(666)
x = np.random.randn(3, 3) * 3
y = np.random.randn(4, 3) * 3
print(x)
print(y)

sts = StandardScaler()
x_sts = sts.fit_transform(x)
print(x_sts)

# ATTENTION 归一化
mms = MinMaxScaler()
x_mms = mms.fit_transform(x)  # 留下比例
y_mms = mms.transform(y)  # 按x的比例
y_mms2 = mms.fit_transform(y)  # 按y的比例
print(x_mms)
print(y_mms)
print(y_mms2)
